<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title>赛事直播-解说员界面</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
    <link rel="stylesheet" href="./css/font.css">
    <link rel="stylesheet" href="./css/xadmin.css">
    <script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
    <script type="text/javascript" src="./lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="./js/xadmin.js"></script>
    <script type="text/javascript" src="../home/js/app.js"></script>
    <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
    <!--[if lt IE 9]>
      <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
      <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>

<body>
    <div class="x-body">
        <form class="layui-form">
            <div class="layui-form-item">
                <label for="username" class="layui-form-label">
                    <span class="x-red">*</span>第几节
                </label>
                <div class="layui-input-inline">
                    <select id="type" name="type" class="valid">
                        <option value="1">第一节</option>
                        <option value="2">第二节</option>
                        <option value="3">第三节</option>
                        <option value="4">第四节</option>
                    </select>
                </div>
            </div>
            <div class="layui-form-item">
                <label for="username" class="layui-form-label">
                    <span class="x-red">*</span>球队
                </label>
                <div class="layui-input-inline">
                    <select id="team_id" name="team_id" class="valid">
                        <option value="1">马刺</option>
                        <option value="4">火箭</option>
                    </select>
                </div>
            </div>
            <div class="layui-form-item layui-form-text">
                <label for="desc" class="layui-form-label">
                    赛况内容
                </label>
                <div class="layui-input-block">
                    <textarea placeholder="请输入内容" id="content" name="content" class="layui-textarea">姚明进 3 分</textarea>
                </div>
            </div>
            <div class="layui-form-item">
                <label for="L_repass" class="layui-form-label">
                </label>
                <button type="submit" class="layui-btn" lay-filter="add" id="submit-btn" lay-submit="">推送</button>
            </div>
        </form>
    </div>
</body>
<script>
var $submitBtn = $('#submit-btn');
$submitBtn.click(function(event) {
    event.preventDefault();
    var formData = $('form').serialize();
    $.get(app.host + "?s=admin/admin/pushMessage&" + formData, function(data) {
        var res = JSON.parse(data);
        console.log(res);
        if (res.code == -1) {
            alert(res.message);
            return;
        }
        if (res.code == 1) {
            alert(res.message);
        }
    });
});
</script>

</html>